package cn.smbms.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.smbms.dao.BillMapper;
import cn.smbms.pojo.Bill;
@Service("billService")
public class BillServiceImpl implements BillService {
	
	@Resource
	private BillMapper billMapper;
	
	
	public BillMapper getBillMapper() {
		return billMapper;
	}

	public void setBillMapper(BillMapper billMapper) {
		this.billMapper = billMapper;
	}

	public List<Bill> getBillList(String productName, Integer providerId, Integer isPayment, Integer currentPageNo,
			Integer pageSize) {
		currentPageNo = (currentPageNo-1)*pageSize;
		return billMapper.getBillList(productName, providerId, isPayment, currentPageNo, pageSize);
	}
	public int getBillCount(String productName, Integer providerId, Integer isPayment) {
		return billMapper.getBillCount(productName, providerId, isPayment);
	}
	
	public Bill getBillById(Integer id) {
		return billMapper.getBillById(id);
	}

	public boolean deleteBillById(Integer delId) {
		boolean i=false;
		if(billMapper.deleteBillById(delId)>0) {
			i=true;
		}
		return i;
	}

	public int modify(Bill bill) {
		return billMapper.modify(bill);
	}

	
	public int add(Bill bill) {
		
		return billMapper.add(bill);
	}

	
	

}
